package linkList;

import exceptions.BadDataException;

public class Node {

	private Object data;
	private Node next;

	public Node(Object data, Node next) throws BadDataException {
		super();
		if (data != null)
			this.data = data;
		else
			throw new BadDataException("The data for the node is null!");
		this.next = next;
	}

	public Object getData() {
		return data;
	}

	public Node getNext() {
		return next;
	}
}
